package com.jsb.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.jsb.mapper.CompanyMapper;
import com.jsb.model.Company;
import com.jsb.model.CompanyExample;

@Service
public class CompanyService{
	
	@Resource
	private CompanyMapper companyMapper;
	
	public void addCompany(Company company) {
		companyMapper.insertSelective(company);
	}
	
	public void delCompanyByUuid(String uuid) {
		companyMapper.deleteByPrimaryKey(uuid);
	}
	
	public void updateCompany(Company company) {
		companyMapper.updateByPrimaryKeySelective(company);
	}
	
	public void updateCompanyByExample(Company company,CompanyExample companyExample){
	    companyMapper.updateByExampleSelective(company,companyExample);
	}
	
	public Company getCompanyByUuid(String uuid) {
		return companyMapper.selectByPrimaryKey(uuid);
	}
	
	public List<Company> getPageCompany(CompanyExample companyExample) {
		return companyMapper.selectPage(companyExample);
	}
	
	public int countCompany(CompanyExample companyExample) {
		return companyMapper.countByExample(companyExample);
	}
	
	public List<Company> selectByExample(CompanyExample example){
	    return companyMapper.selectByExample(example);
	}
}
